<?php
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true);



require_once 'php/db.php';
require_once 'php/dbClinica.php';
require_once 'php/dbExame.php';
require_once 'php/dbLaboratorio.php';
require_once 'php/dbPaciente.php';
require_once 'php/dbFuncionario.php';
require_once 'php/dbMedico.php';
require_once 'php/dbAgendamento.php';

require_once 'browser/ZendAmfServiceBrowser.php';

//objetos

require_once 'php/objetos/Clinica.php';
require_once 'php/objetos/Exame.php';
require_once 'php/objetos/Laboratorio.php';
require_once 'php/objetos/Paciente.php';
require_once 'php/objetos/Funcionario.php';
require_once 'php/objetos/Medico.php';
require_once 'php/objetos/Agendamento.php';

$server = new Zend_Amf_Server();
$server->setProduction(false);

$server->addDirectory(dirname(__FILE__)."/php/");


$server->setClass('dbClinica');
$server->setClass('dbExame');
$server->setClass('dbLaboratorio');
$server->setClass('dbPaciente');
$server->setClass('dbFuncionario');
$server->setClass('dbMedico');
$server->setClass('dbAgendamento');


$server->setClassMap('Clinica', 'Clinica');
$server->setClassMap('Exame', 'Exame');
$server->setClassMap('Funcionario', 'Funcionario');
$server->setClassMap('Paciente', 'Paciente');
$server->setClassMap('Laboratorio', 'Laboratorio');
$server->setClassMap('Medico', 'Medico');
$server->setClassMap('Agendamento', 'Agendamento');


$server->setClass("ZendAmfServiceBrowser");
ZendAmfServiceBrowser::$ZEND_AMF_SERVER = $server;

echo $server->handle();